﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MobileSales.Model.Products;
using System.ServiceModel.Web;
using MobileSales.Model.Exceptions;

namespace MobileSales.Server.RestServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IProductServiceREST" in both code and config file together.
    [ServiceContract]
    public interface IProductServiceREST
    {
        #region Product management
        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetProduct/{productId}")]
        Product GetProduct(string productId);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetProductList")]
        IEnumerable<Product> GetProductList(); 
        #endregion

        #region Category management
        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetCategory/{categoryId}")]
        Category GetCategory(string categoryId);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetCategoryTree")]
        IEnumerable<Category> GetCategoryTree();

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetCategoryList")]
        IEnumerable<Category> GetCategoryList(); 

        #endregion

        #region Tax Management
        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetTaxList")]
        IEnumerable<Tax> GetTaxList();

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetTax/{taxId}")]
        Tax GetTax(string taxId); 
        #endregion

        #region Unit management
        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetUnitList")]
        IEnumerable<Unit> GetUnitList();

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetUnit/{unitId}")]
        Unit GetUnit(string unitId); 
        #endregion
    }
}
